
"Email: Daniel-8bit@outlook.com


"=====================================================
"=====================================================

" basic config
set showmatch
set ignorecase
set nu
set relativenumber
syntax on
set cursorline
set tabstop=4
set encoding=utf-8
nnoremap <SPACE> <Nop>
let mapleader=" "
" auto pairs by inoremap
inoremap ( ()<Esc>i
inoremap [ []<Esc>i
inoremap < <><Esc>i
inoremap { {}<Esc>i
inoremap ' ''<Esc>i
inoremap " ""<Esc>i
inoremap { {}<Esc>i
"======================================================
"======================================================


"===
"
"vim-plug
"url: https://github.com/junegunn/vim-plug
"
"===
call plug#begin('$HOME/.config/nvim/plugged')

" nerdtree: a file system exploer for the Vim editor
" url: https://github.com/preservim/nerdtree
"
Plug 'preservim/nerdtree'

" indentLine: This plugin is used for displaying thin vertical lines at each indentation level for code indented with spaces.
" url: https://github.com/Yggdroot/indentLine
"
Plug 'Yggdroot/indentLine'

" vim-airline: Lean & mean status/tabline for vim that's light as air.
" url: https://github.com/vim-airline/vim-airline
"
Plug 'vim-airline/vim-airline'

" vim-airline-themes: set themes of vim-airline
" url: https://github.com/vim-airline/vim-airline-themes#vim-airline-themes--
"
Plug 'vim-airline/vim-airline-themes'

" tagbar: 
" url: https://github.com/preservim/tagbar
"
Plug 'preservim/tagbar'

" coc.nvim: Conquer of Completion
" url: https://github.com/neoclide/coc.nvim
" need nodejs>=12.12
Plug 'neoclide/coc.nvim', {'branch': 'release'}

" gruvbox

Plug 'morhetz/gruvbox'

"LeaderF
"
"
Plug 'Yggdroot/LeaderF', { 'do': './install.sh' }

"autopairs
"
"
Plug 'jiangmiao/auto-pairs'

"nerdcommenter
"
"
Plug 'preservim/nerdcommenter'

" vim-devicons
"
"
Plug 'ryanoasis/vim-devicons'

call plug#end()


"===
"
"nerdtree
"
"===
let g:NERDTreeWinSize = 25
nnoremap <C-n> :NERDTree<CR>
nnoremap <C-t> :NERDTreeToggle<CR>


"===
"
"indentLine
"
"===
let g:indentLine_enabled = 1
let g:indentLine_conceallevel = 2
let g:indent_guides_guide_size = 1  " 指定对齐线的尺寸
let g:indentLine_char_list = ['|', '¦', '┆', '┊']

"===
"
"vim-airline
"
"===
let g:airline_powerline_fonts = 1

" enable smarter_tab_line of airline
let g:airline#extensions#tabline#enabled = 1
"
let g:airline#extensions#tabline#formatter = 'default'

" 设置切换tab的快捷键 <\> + <i> 切换到第i个 tab
nmap <leader>1 <Plug>AirlineSelectTab1
nmap <leader>2 <Plug>AirlineSelectTab2
nmap <leader>3 <Plug>AirlineSelectTab3
nmap <leader>4 <Plug>AirlineSelectTab4
nmap <leader>5 <Plug>AirlineSelectTab5
nmap <leader>6 <Plug>AirlineSelectTab6
nmap <leader>7 <Plug>AirlineSelectTab7
nmap <leader>8 <Plug>AirlineSelectTab8
nmap <leader>9 <Plug>AirlineSelectTab9
" 设置切换tab的快捷键 <\> + <-> 切换到前一个 tab
nmap <leader>- <Plug>AirlineSelectPrevTab
" 设置切换tab的快捷键 <\> + <+> 切换到后一个 tab
nmap <leader>+ <Plug>AirlineSelectNextTab

"===
"
"vim-airline-themes
"for a better appearance, please install powerline fonts
"in most cases, you can install with apt/yum/zypper directly
"===
"
"Input :AirlineTheme, which will help you choose
let g:airline_theme='hybrid'
"let g:airline_solarized_bg='dark'


"===
"
"tagbar
"
"===
let g:tagbar_width=30
nmap <F8> :TagbarToggle<CR>

"===
"
"gruvbox
"
"===
colorscheme gruvbox
set background=dark


"===
"
"Coc.nvim
"
"===

" Use tab for trigger completion with characters ahead and navigate.
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
" other plugin before putting this into your config.
inoremap <silent><expr> <TAB>
      \ pumvisible() ? "\<C-n>" :
      \ <SID>check_back_space() ? "\<TAB>" :
      \ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"


"===
"
"vim-devicons
"
"===
set guifont=DroidSansMono\ Nerd\ Font\ 11

